//
// Created by ailoc on 2023/10/21.
//

#ifndef FA_LEARNING_RULEBOOK_H
#define FA_LEARNING_RULEBOOK_H

#include <string>
#include <map>
#include <utility>
#include <set>
#include "mvd.h"

typedef struct {
    char overwrite_char;
    mvd direction;
    std::string next_state;
}OptAction;

class RuleBook {
private:
    std::map<std::pair<std::string,char>,OptAction> ruleBook;
    std::string start_state;
    std::set<std::string> final_stateSet;
public:
    auto addRule(std::string current_state,char current_char,char overwrite_char,mvd direction,std::string next_state) -> RuleBook*;

    const std::map<std::pair<std::string, char>, OptAction> &getRuleBook() const;

    void setStartState(const std::string &startState);

    const std::string &getStartState() const;

    void setFinalStateSet(const std::set<std::string> &finalStateSet);

    const std::set<std::string> &getFinalStateSet() const;
};


#endif //FA_LEARNING_RULEBOOK_H
